package com.xiangwushuo.framework.activity.main.fragment.find

import android.app.Application
import android.os.Bundle
import com.lib.common.base.mvvm.CommonFragmentViewModel
import androidx.databinding.ObservableField
import com.lib.common.constant.INTENT_KEY_PARAM1
import com.lib.common.constant.INTENT_KEY_PARAM2

/**
 * Copyright (C), 2019-2020
 * FileName: FindViewModel
 * Author:
 * Date: 2020-01-01 00:00
 * Description: 发现 fragment的 ViewModel
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
class FindViewModel(application: Application) : CommonFragmentViewModel(application) {

    /**
     * xml 文件直接调用的变量
     */
    var mText = ObservableField<String>()

    override fun initData(bundle: Bundle?) {
        val param1 = bundle?.getString(INTENT_KEY_PARAM1)
        val param2 = bundle?.getString(INTENT_KEY_PARAM2)

        mText.set("发现")
        sendEvent(FindFragment.EVENT_XXX, "extraParam")
        sendEventToActivity(FindFragment.FRAGMENT_EVENT_XXXX)
    }
}